find score of an array after marking all elements